<?php
/**
 *
 *
 */
abstract class Yz_Model_Abstract
    extends Yz_Object
    implements Yz_Model_Interface
{

    /** Reference to the module
     *  @var Yz_Module_Interface
     */
    protected $module;
    /**
     *  @var Yz_Config_Interface
     */
    protected $config;

    /** Model's constructor requires module
     *  @param Yz_Module_Interface $module
     */
    public function __construct( Yz_Module_Interface $module )
    {
        debug();
        $this->module = $module;
    }

    /** get Model's config
     *  @return Yz_Config_Interface
     */
    public function getConfig()
    {
        debug();
        $config =& $this->config;
        if (null === $config) {
            $config = $this->module
                ->getConfig()
                ->fetchSectionWithInherit('Model.'.$this->shortClassName());
        }
        return $config;
    }

}
